
import request from '@/plugin/axios'

// 获取列表
export function getuserrolelist (params) {
  return request({
    url: '/upms/userrole/list',
    method: 'get',
    params: request.adornParams(params)
  })
}
// 某个角色的用户字典信息【返回id和name】
export function getUserByRoleId (pkRole) {
    return request({
      url: '/upms/userrole/dict/'+pkRole,
      method: 'get',
      params: request.adornParams({})
    })
  }
// 获取信息
export function getuserroleinfo (id) {
  return request({
    url: '/upms/userrole/info/' + id,
    method: 'get',
    params: request.adornParams({})
  })
}

// 添加
export function adduserrole (data) {
  return request({
    url: '/upms/userrole/save',
    method: 'post',
    data
  })
}

// 修改
export function updateuserrole (data) {
  return request({
    url: '/upms/userrole/update',
    method: 'put',
    data
  })
}

// 批量删除
export function delBatchuserrole (ids) {
  return request({
    url: '/upms/userrole/delete',
    method: 'post',
    data: request.adornData(ids, false)
  })
}

// 删除
export function deluserrole(id) {
  return request({
    url: '/upms/userrole/delete/' + id,
    method: 'delete',
  })
}